<!DOCTYPE html>
<script src="../resources/js-test.js"></script>
<div>Hello, world!</div>
<script>
description("Tests that testRunner.runIdleTasks will force idle tasks to run.");
self.jsTestIsAsync = true;

var x = false;

function cb1(t) {
  shouldBeFalse("x");
  x = true;
}

function cb2(t) {
  shouldBeTrue("x");
  finishJSTest();
}

requestIdleCallback(cb1);
if (self.testRunner)
  testRunner.runIdleTasks(cb2);
else
  requestIdleCallback(cb2);
</script>
